package com.zzl.finance.order.constant;

import com.zzl.finance.order.dto.KeyValue;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : spp
 * @date : 2022/1/6 20:51
 */
public enum InvoiceStatusEnum {
    /**
     * 融资服务
     */
    ALL(0, "全部"),
    INVOICE(1, "已开票"),

    INVOICE_ING(2, "申请中"),

    INVALID_VOIDED(3, "已作废");


    private Integer code;
    private String value;


    InvoiceStatusEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public static List<KeyValue> getList() {
        /*TODO*/
        return new ArrayList<>();
    }

    public static String getValue(Integer code) {
        for (InvoiceStatusEnum statusEnum : InvoiceStatusEnum.values()) {
            if (statusEnum.code.equals(code)) {
                return statusEnum.value;
            }
        }
        return "";
    }


    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }
}
